/**
 * 
 */
package org.insia.smartposse.metier.webservice;

import java.io.Serializable;

import org.insia.smartposse.metier.Company;
import org.insia.smartposse.metier.Project;

/**
 * @author raguerri
 * @since 18 avr. 07
 * @version 0.0.1
 * 
 */
public class LightCompany 
extends LightUser 
implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1880789596426637958L;
	private String name;
	private String address;
	private String url;
	
	/**
	 * 
	 *
	 */
	public LightCompany() {
		
	}
	
	/**
	 * 
	 * @param cmp
	 */
	public LightCompany(Company cmp) {
		id = cmp.getId();
		gender = cmp.getGender();
		
		login = cmp.getLogin();
		password = cmp.getPassword();
		firstName = cmp.getFirstName();
		lastName = cmp.getLastName();
		email = cmp.getEmail();
		
		name = cmp.getName();
		address = cmp.getAddress();
		url = cmp.getUrl();
		
		type = 'c';
		
		if (cmp.getProjectSet().size() != 0) {
			for (Project proj : cmp.getProjectSet()) {
				projectSet.add(proj.setLight());
			}
		}
		
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
}
